<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client_reserve_form.css" />
<link rel="stylesheet" href="${staticServer}/css/consultant_client_tracking.css" />
<link rel="stylesheet" href="${staticServer}/css/public.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/city.js"></script>
<script src="${staticServer}/inc/js/htmlfilter.js"></script>
<script src="${staticServer}/inc/js/datepicker.js"></script>
<script src="${staticServer}/inc/js/model_resp.js?1.2"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>
<script src="${staticServer}/inc/js/model_win.js?1.2"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script
	src="${staticServer}/js/web/consultant_client_reserve_form.js?2.1"></script>
<script src="${staticServer}/js/web/consultant_client_state.js?1.2"></script>

<style>
#__DIV_CLIENT_SELECTOR {
	width: 590px;
	height: 350px;
	border: 5px solid #f0f0f0;
	background: #f9f9f9;
}

#__DIV_CLIENT_SELECTOR dt {
	color: #fff;
	font-size: 16px;
	font-weight: bold;
	padding-left: 10px;
	padding-right: 10px;
	height: 40px;
	line-height: 40px;
	background: #D8A5CC;
	cursor: pointer;;
}

#__DIV_CLIENT_SELECTOR dt span, #__DIV_CLIENT_SELECTOR dt a {
	float: left;
}

#__DIV_CLIENT_SELECTOR dt a {
	color: #E3BFDB;
	float: right;
	font-size: 14px;
}

#__DIV_CLIENT_SELECTOR dt a:hover {
	color: #FFF;
}

#__DIV_CLIENT_SELECTOR #form {
	width: 90%;
	margin: 0 auto;
	padding: 10px 0 15px 10px;
	min-height: 25px;
}

#__DIV_CLIENT_SELECTOR #form label {
	display: block;
	float: left;
	height: 25px;
	color: #999;
	font-size: 15px;
	font-weight: bold;
	line-height: 25px;
	text-align: right;
}

#__DIV_CLIENT_SELECTOR #form label span {
	color: #ddd;
	font-size: 12px;
	font-weight: normal;
	font-size: 12px;
}

#__DIV_CLIENT_SELECTOR #form input {
	display: block;
	float: left;
}

#__DIV_CLIENT_SELECTOR #body {
	position: relative;
	display: block;
	width: 90%;
	height: 240px;
	margin: 0 auto;
	overflow-y: auto;
	padding: 2px;
	border: 1px dotted #ddd;
}

#__DIV_CLIENT_SELECTOR #body ul li {
	font-size: 14px;
	list-style: none;
	padding: 10px 20px 10px 20px;
	border-bottom: 1px solid #ccc;
	cursor: default;
}

#__DIV_CLIENT_SELECTOR #body ul li.empty {
	color: #999;
	font-size: 14px;
	list-style: none;
	padding: 10px 20px 10px 20px;
	border: none;
}

.bold {
	font-weight: bold;
}

#__DIV_CLIENT_SELECTOR #body ul li.selected {
	color: #CCAACC;
	border-color: #99cc00;
	background: #fff url(${staticServer}/img/ok.png) no-repeat 95%;
}

#__DIV_CLIENT_SELECTOR #form input {
	display: block;
	float: left;
}

.__CLIENT_INFO_LIST {
	min-height: 31px;
}

.__CLIENT_INFO_LIST span {
	color: #DDBBCC;
	min-width: 130px;
	min-height: 20px;
	height: auto;
	display: block;
	float: left;
}
</style>
<style type="text/css">
#statelist label {
	display: block;
	float: left;
	width: 120px;
}

#statelist2 label {
	display: block;
	float: left;
	width: 180px;
}
</style>
<script>
var contextPath='${contextPath}';

	$(function(){
		
		init_city( "province", "city" );
		
		$("#region").val("<#if reserve??>${reserve.region}</#if>");
		$("#time").val("<#if reserve??>${reserve.time}<#else>${time}</#if>");
		$("#needtime").val("<#if reserve?? && reserve.needtime!=null>${reserve.needtime}<#else>1.5</#if>");
	});

var addFloat = function(keyname){
	$("#keyname").val(keyname);
	$("#__DIV_CLIENT_SELECTOR_MASK").show();
	$("#__DIV_CLIENT_SELECTOR1").show();
	
}
var addFloat2 = function(keyname){
	$("#keyname").val(keyname);
	$("#__DIV_CLIENT_SELECTOR_MASK").show();
	$("#__DIV_CLIENT_SELECTOR2").show();
	
}

var quxiao = function(){
	$("#__DIV_CLIENT_SELECTOR_MASK").hide();
	$("#__DIV_CLIENT_SELECTOR1").hide();
}
var quxiao2 = function(){
	$("#__DIV_CLIENT_SELECTOR_MASK").hide();
	$("#__DIV_CLIENT_SELECTOR2").hide();
}


function submit(){
	var data = {};
	// 客户资料
	data.keyname = $("#keyname").val();
	var id = $("#traId").val();
	data.remark = $( "#remark" ).html();
	data.protime = $("#proTime").val();
	data.target = $("#target").val();
	var states = [];

  	$( "#statelist input:checked" ).each( function(){
		var val = $( this ).attr( "value" );
		states.push( val );
	} );
	
	data.states = states.join( "," );
	
	if((data.states).indexOf("138g5wfwm1mx")>=0 && data.protime ==""){
	alert("请设置定时提醒的时间。");
	return false;
	}
	
	if((data.states).indexOf("o3dpi9gzuol4")>=0 && data.target ==""){
		alert("请设置转交老师。");
		return false;
	}
	
	if( ( data.remark == "" || data.remark == "无" ) && data.invalid == 0 )
	{
		alert( "跟踪备注信息必须填写。" );
		return;
	}

	$.post( "${contextPath}/index/add_client_follow.json", data, function( d )
	{
		$("#__DIV_CLIENT_SELECTOR_MASK").hide();
		$("#__DIV_CLIENT_SELECTOR1").hide();
	}, "json" );
}

function submit1(){
	var data = {};
	// 客户资料
	data.keyname = $("#keynames").val();
	var id = $("#traId").val();
	var states = [];
  	$( "#statelist2 input:checked" ).each( function(){
		var val = $( this ).attr( "value" );
		states.push( val );
	} );
	data.states = states.join( "," );

	$.post( "${contextPath}/index/updatereserve2.json", data, function( d )
	{
		$("#__DIV_CLIENT_SELECTOR_MASK").hide();
		$("#__DIV_CLIENT_SELECTOR2").hide();
		alert( "非测评原因已保存");
	}, "json" );
}
var timeout = function(){
	var b = $(".odd1_row").visible();
	if(b == false){
		$(".Zebra_DatePicker").css('z-index','9900');
		$(".odd1_row").show();
	}else{
		$(".odd1_row").hide();
	}
}	
	
var target = function(){
	var a = $(".odd2_row").visible();
	if(a == false){
		$(".odd2_row").show();
	}else{
		$(".odd2_row").hide();	
	}
}

function btnShow(obj){
	 var b = $(obj).siblings('.caption').parent().parent().find('p:not(:first)').visible();
	 var s = $(obj).siblings('.caption').parent().parent().parent().children();
	 var h = $(obj).siblings('.caption').parent();
	 var f = $(obj).siblings('.caption').parent().parent().parent().children('li:last');
	 var l = $("#btnSearchTracking");
	 
	 var remind = $(obj).siblings('.caption').parent().parent().find('#remind').val();
	 var sh = null;
	 if(remind!=""){
		 sh = $(obj).siblings('.caption').parent().parent().parent().children().children();
		}else{
		 sh = $(obj).siblings('.caption').parent().parent().parent().children().children().not("#re");
		}	
	 if(b == false){
			 sh.show();
			 s.show();
			 l.hide();
	 }else{
		 	sh.hide();
		 	h.show();
		 	f.hide();
		 	l.show();
	 }
	}
	
</script>
</head>

<body>
	<input id="keynames" type="hidden"
		value="<#if reserve??>${reserve.keyname}</#if>">
	<input id="keyname" type="hidden"
		value="<#if reserve??>${reserve.client}</#if>">
	<input type="hidden" id="dates" value="${date}">
	<input type="hidden" id="times" value="${time}">
	<input type="hidden" id="reg" value="${region}">

	<div id="__DIV_CLIENT_SELECTOR1"
		style="position: absolute; z-index: 9900; top: 200px; left: 304px; display: none; width: 900px; max-height: 477px; background-color: #FFF;">
		<table>
			<tr class="fields">
				<th colspan="2">添加客户跟踪记录</th>
			</tr>
			<tr class="even_row">
				<th width="25%">此次客户状态
					<p class="caption">状态可多选，不选择代表“无变化”</p>
				</th>
				<td width="75%" id="statelist"><label for="state_1"
					title="明确不参加"><input id="state_1" type="checkbox"
						value="qenzgu6wde3c">不参加</label> <label for="state_2"
					title="有较高意向和兴趣"><input id="state_2" type="checkbox"
						value="nhb8wyq1nda5">高意向</label> <label for="state_3"
					title="已经发送相关协议"><input id="state_3" type="checkbox"
						value="qyebkhp2x67y">已发协议</label> <label for="state_4"
					title="计划另行跟踪"><input id="state_4" type="checkbox"
						onclick="timeout()" value="138g5wfwm1mx">计划跟踪</label> <label
					for="state_5" title="已转交其它老师"><input id="state_5"
						type="checkbox" onclick="target()" value="o3dpi9gzuol4">已转交</label>
					<label for="state_6" title="已成功预约测评"><input id="state_6"
						type="checkbox" value="mldqhlrg1sad">已预约</label> <label
					for="state_7" title="已完成测评"><input id="state_7"
						type="checkbox" value="caoodurhkcl6">已测评</label> <label
					for="state_8" title="已缴费开始训练"><input id="state_8"
						type="checkbox" value="znouq0wygvbb">已缴费</label> <label
					for="state_9" title="已退费中止训练"><input id="state_9"
						type="checkbox" value="krm8s91foapx">已退费</label> <label
					for="state_11" title="预约成功的客户未出现"><input id="state_11"
						type="checkbox" value="n9fjwyx5w74g">未出现</label> <label
					for="state_12" title=""><input id="state_12"
						type="checkbox" value="n4f79h2giie6">意向一般</label> <label
					for="state_13" title=""><input id="state_13"
						type="checkbox" value="rym23z0aopkk">一直关机</label> <label
					for="state_14" title="无法接通"><input id="state_14"
						type="checkbox" value="pflp6f14pers">无法接通</label> <label
					for="state_15" title=""><input id="state_15"
						type="checkbox" value="ikslzv14e1dt">接通挂断</label> <label
					for="state_16" title=""><input id="state_16"
						type="checkbox" value="uj69ezpbh5a6">无人接听</label></td>
			</tr>
			<tr class="odd1_row" style="display: none;">
				<th width="25%" style="padding: 15px 10px 15px 10px;">定时提醒</th>
				<td width="75%"><div id="jhtime" contenteditable="true">
						<input type="text" name="pro_time" id="proTime" size="15" value=""
							rel="DATE::Y-m-d" />
						<p class="caption">需要计划在某日期跟踪时，设置“定时提醒”，当天会有消息提醒！</p></td>
			</tr>
			<tr class="odd2_row" style="display: none;">
				<th width="25%" style="padding: 15px 10px 15px 10px;">转交目标
					<p class="caption">转交目标必须同样是咨询师</p>
				</th>
				<td width="75%"><div id="lodusername" contenteditable="true">
						<select id="target">
							<option value="">-- 请选择目标 --</option> <#if uList??> <#list uList
							as list>
							<option value="${list.username}">${list.nickname}（${list.regions}-${list.departments}-${list.job}）</option>
							</#list> </#if> <#if uLists??> <#list uLists as lists>
							<option value="${lists.username}">${lists.nickname}（${lists.regions}-${lists.departments}-${lists.job}）</option>
							</#list> </#if>
						</select>
						<p class="caption">成功转交后，你将无法在对该客户进行维护和跟踪，且从你个人客户资源中去除。</p></td>
			</tr>
			<tr class="odd_row">
				<th width="25%" style="padding: 15px 10px 15px 10px;">跟踪情况
					<p class="caption">客户咨询内容摘要，如“咨询问题”等</p>
				</th>
				<td width="75%"><div id="remark" contenteditable="true">无</div></td>
			</tr>
			<tr>
				<th colspan="2" style="height: 40px;">
					<div style="width: 120px; margin-left: auto; margin-right: auto;">
						<a onclick="quxiao()">[ 取消 ]</a> <a onclick="submit()">[ 确定 ]</a>
					</div>
				</th>
			</tr>
		</table>
	</div>

	<div id="__DIV_CLIENT_SELECTOR2"
		style="position: absolute; z-index: 9900; top: 200px; left: 304px; display: none; width: 650px; max-height: 477px; background-color: #FFF;">
		<table>
			<tr class="fields">
				<th colspan="2">请选择非测评的原因</th>
			</tr>
			<tr class="even_row">
				<th width="25%">可选原因
					<p class="caption">原因可多选，必须选择一个</p>
				</th>
				<td width="75%" id="statelist2"
					style="width: 160px; margin-left: auto; margin-right: auto;">
					<label for="state_1" title="独自了解(不带孩子)"><input id="state_17"
						type="checkbox" value="独自了解(不带孩子)">独自了解(不带孩子)</label> <label for="state_2"
					title="非适龄(五周岁以下)"><input id="state_18" type="checkbox"
						value="非适龄(五周岁以下)">非适龄(五周岁以下)</label> <label for="state_3" title="毕业讲解"><input
						id="state_19" type="checkbox" value="毕业讲解">毕业讲解</label> <label
					for="state_4" title="二次到访"><input id="state_20"
						type="checkbox" value="二次到访">二次到访</label> <label for="state_5"
					title="孩子极度不配合，情绪暴躁"><input id="state_21" type="checkbox"
						value="孩子极度不配合，情绪暴躁">孩子极度不配合，情绪暴躁</label>
				</td>
			</tr>
			<tr class="odd1_row1" style="display: none;">
				<th width="25%" style="padding: 15px 10px 15px 10px;">请写出您遇到的特殊原因
				</th>
				<td width="75%"><div id="qt_yuanyin" contenteditable="true">
						<input type="text" name="yuanyin" id="yuanyin" size="50" value="" /></td>
			</tr>
			<tr>
				<th colspan="2" style="height: 40px;">
					<div style="width: 120px; margin-left: auto; margin-right: auto;">
						<a onclick="quxiao2()">[ 取消 ]</a> <a onclick="submit1()">[ 确定
							]</a>
					</div>
				</th>
			</tr>
		</table>
	</div>

	<div id="home_link">
		<ul>
			<li>竞思教育网络办公系统 v1.1 beta</li>
			<li>&gt;</li>
			<li>咨询师</li>
			<li>&gt;</li>
			<li class="current">客户预约</li>
		</ul>
	</div>
	<div id="caption">
		<ul>
			<li><span class="title">操作提示：</span></li>
			<li>Ctrl+Enter 提交</li>
		</ul>
	</div>
	<div id="container">
		<div id="title">（客户预约数据）</div>
		<table id="tbl_client">
			<tr class="fields">
				<th colspan="2">客户资料<a id="btn_detailed">（点击查看详细资料）</a></th>
			</tr>
			<tr>
				<th width="25%">客户姓名/称呼</th>
				<td width="75%"><span id="nickname"
					name="<#if client??>${client.keyname}</#if>"
					class="stress unit hand"><#if
						client??>${client.nickname}</#if> <em class="valid"><#if
							keyname=="undefined" || keyname=="">- -</#if><#if client??><#if
							client.invalid=="0">（有效客户）<#elseif
							client.invalid=="1">（无效客户）</#if></#if></em>
				</span> <#if keyname=="undefined" || keyname==""> <span id="btnSelectBox">（<a
						id="btnSelect" class="underline">选择待预约客户</a>）
				</span> </#if></td>
			</tr>
			<tr>
				<th>客户来源渠道</th>
				<td id="source"><#if client??>${client.sourcens}</#if></td>
			</tr>
			<tr rel="hide">
				<th>关键字</th>
				<td id="keyword"><#if client??>${client.keyword}</#if></td>
			</tr>
			<tr rel="hide">
				<th>客户类别</th>
				<td id="category"><#if client??>${client.categoryns}</#if></td>
			</tr>
			<tr>
				<th>所在地</th>
				<td id="address"><#if
					client??>${client.province}${client.city}</#if></td>
			</tr>
			<tr>
				<th>联系电话</th>
				<td id="phone"><#if client??> <#if client.phlist??> <#list
					client.phlist as phlist> <#if phlist.name!=''>
					${phlist.name}：${phlist.phone} <#elseif phlist.guanxi!=''>
					${phlist.guanxi}：${phlist.phone} <#else> ${phlist.phone} </#if>
					</#list> <#elseif client.phone!="" &&
					client.phone?contains('[]')==false> ${client.phone} <#elseif
					client.qq!=""> <em class="caption">QQ:</em>${client.qq} <#elseif
					client.weixin!=""> <em class="caption">微信:</em>${client.weixin}
					<#elseif client.email!=""> <em class="caption">email:</em>${client.email}
					</#if> </#if>
				</td>
			</tr>
			<tr rel="hide">
				<th>电子邮箱</th>
				<td id="email"><#if client??>${client.email}</#if></td>
			</tr>
			<tr rel="hide">
				<th>QQ</th>
				<td id="qq"><#if client??>${client.qq}</#if></td>
			</tr>
			<tr rel="hide">
				<th>IP地址</th>
				<td id="ip"><#if client??>${client.ip}</#if></td>
			</tr>
			<tr rel="hide">
				<th>备注信息</th>
				<td id="desc"><#if client??>${client.descs}</#if></td>
			</tr>
		</table>
		<table id="tbl_student">
			<tr class="fields">
				<th colspan="2">选择待测评的学员<a id="btn_students">（点击查看客户名下所有学员）</a></th>
			</tr>
			<tr rel="hide">
				<td colspan="2" id="studentlst"><#if stuList??> <#list stuList
					as list>
					<ul>
						<li rel="${list.keyname}" class="selected">
							<p class="title">
								<span>${list.nickname}</span>
							</p>
							<p>
								<b>性别</b><span>${list.sex}</span>
							</p>
							<p>
								<b>年龄</b><span>${list.age} 岁</span>
							</p>
							<p>
								<b>生日</b><span><em class="caption">${list.birthdays}</em></span>
							</p>
							<p>
								<b>学校</b><span>${list.school}</span>
							</p>
							<p>
								<b>学员特征</b>
							</p>
							<div class="content">${list.feature}</div>
						</li>
					</ul> </#list> </#if>
				</td>
			</tr>
		</table>
		<table id="tbl_reserve">
			<tr class="fields">
				<th colspan="2">预约表单</th>
			</tr>
			<tr>
				<th width="25%">预约发起人</th>
				<td width="75%"><span class="stress unit hand"
					id="user_nickname" name="<#if reserve??>${reserve.nickname}</#if>"><#if
						reserve??>${reserve.username}</#if></span>
					<#if upUserStr??>
						<#list upUserStr as strUser>
							<span class="stress unit hand" id="updateUser_name">${strUser}</span>
						</#list>
					</#if>
				</td>
			</tr>
			<tr>
				<th width="25%">接待中心</th>
				<td width="75%"><select id="region"> <#if offList??>
						<#list offList as list>
						<option value="${list.keyname}">${list.name}</option> </#list>
						</#if>
				</select></td>
			</tr>
			<tr>
				<th width="25%">预约时间</th>
				<td width="75%"><input type="text" id="date"
					value="<#if reserve??>${reserve.date}<#else>${date}</#if>"
					rel="DATE::Y-m-d" /> <select id="time">
						<option value="">-- 请选择 --</option>
						<option>09:30</option>
						<option>10:00</option>
						<option>10:30</option>
						<option>11:00</option>
						<option>11:30</option>
						<option>12:00</option>
						<option>12:30</option>
						<option>13:00</option>
						<option>13:30</option>
						<option>14:00</option>
						<option>14:30</option>
						<option>15:00</option>
						<option>15:30</option>
						<option>16:00</option>
						<option>16:30</option>
						<option>17:00</option>
						<option>17:30</option>
						<option>18:00</option>
						<option>18:30</option>
						<option>19:00</option>
						<option>19:30</option>
				</select>
					<p class="caption">当设置好预约时间后，需要即时查询该指定时间是否有空闲咨询师能够接待预约，否则只能改期。</p></td>
			</tr>
			<tr>
				<th width="25%">非本中心接待老师选择</th>
				<td><select width="75%" id="province"></select> <em class="caption">（省份）</em> 
				<select id="city"></select> <em class="caption">（城市）</em></td>
			</tr>
			<tr>
				<th width="25%">接待老师</th>
				<td width="75%" id="receptionlst">
					<div>
						<a id="btnSearchReception" class="underline">[ 立即查询 ]</a> <a
							id="btnRestoryReception" class="underline" style="display: none">[
							还原预约时间和接待人 ]</a> <span class="rect stress">提醒：客户将被强制转交</span>

					</div>
					<ul style="overflow: hidden;">
						<#if reserve??> <#if reserve.reception_u!=null>
						<li id="${usname}" class="unit selected"><label
							class="stress">${reserve.reception_u}</label>，课程顾问</li></#if> </#if>
					</ul>
					<p class="line"></p>
					<p class="caption">查询该中心可接待客户的咨询师名单，修改时会排除当前咨询师</p>
					<p class="caption" style="color: #c60;">
						<b>注意：</b>若自己登记的客户预约到与自己不同的中心时，客户将强制转交给接待老师。<br>
						后续跟进将由接待老师负责，同时系统会记录你为原始客户登记人。
					</p>
				</td>
			</tr>

			<tr rel="" class="even_row"
				<#if reserve?? && reserve.keyname!=''>style="display:
				table-row;"</#if> style="display:none;">
				<th width="25%">预约状态</th>
				<td width="75%">当前状态：
				<#if reserve??>
				<#if reserve.state == "1" >
				<span class="confirmed unit hand">待确认</span>
				<#elseif reserve.state == "2">
				<span class="completed unit hand">已出现</span>
				<#elseif reserve.state == "3">
				<span class="expired unit hand">未出现</span>
				</#if>
				</#if>
					<p id="statebx">
						目标状态：<select id="state"><option value="">-- 请选择状态 --</option><option value="1" title="客户需在预约时间内进一步确认">待确认</option><option value="2" title="客户已上门进行测评">已出现</option><option value="3" title="客户未出现，预约已过期">未出现</option></select><a id="btnAddTracking" onclick="addFloat('<#if reserve??>${reserve.client}</#if>')" style="display: none;">[ 客户跟踪 ]</a>
					</p>
					<p class="caption">当客户预约已经过期时，会自动更为过期状态，并同时可提交新的预约。</p></td>
			</tr>
			<tr>
				<th width="25%">短信通知
					<p class="caption">预约客户后的短信通知状态</p>
				</th>
				<td width="75%" id="smsbx"><input id="sms" type="checkbox"
					checked<#if reserve?? &&
					reserve.sms=="">checked="checked"</#if> <#if reserve?? &&
					reserve.sms=="1">checked="checked"</#if> /><label for="sms">是否已发送短信</label>
					<p class="caption">当成功预约客户后，需要尽快将预约相关信息通知到客户。</p></td>
			</tr>
			<tr>
				<th width="25%">预约类型</th>
				<td width="75%"><input id="non" type="checkbox" value="fei"
					onclick="addFloat2('<#if reserve??>${reserve.client}</#if>')"<#if
					reserve?? && reserve.non=="1">checked="checked"</#if> /><label
					for="non">是否为非测评类型</label>
					<p class="caption">非测评类型，一般为时间较短的业务类型，如缴费、续费、咨询等。</p>
					<p class="caption">勾选为非测评类型的预约时，可以不指定测评学员。</p> <#if reserve?? &&
					reserve.non=="1"><font color="red" size=3><b>非测评的原因：</b><#if
						reserve??>${reserve.state2}</#if></font></#if></td>
			</tr>
			<tr rel="hide2">
				<th width="25%">非测评类型提示</th>
				<td width="75%"><input type="text" id="notice" size="50" />
					<p class="caption">当作为非测评类型的预约时，此处填写的信息将显示在预约表中，而不会显示学员资料。</p></td>
			</tr>
			<tr>
				<th width="25%">预计需要时间</th>
				<td width="75%" id="needtimebx"><select id="needtime">
						<option value="0.5">0.5 小时</option>
						<option value="1.0">1.0 小时</option>
						<option value="1.5" selected>1.5 小时</option>
						<option value="2.0">2.0 小时</option>
						<option value="2.5">2.5 小时</option>
						<option value="3.0">3.0 小时</option>
				</select>

					<p class="caption">预约客户上门接待时，所需要的大概时间，请根据该客户所携待测评学员数量进行调整</p>
					<p class="caption">接待时间默认 1.5 小时，将影响咨询师个人当天其它预约安排</p>
					<p class="caption">若是预约非测评，如缴费续费、咨询等请相应减少占用时间</p></td>
			</tr>
			<tr>
				<th width="25%" style="padding: 15px 10px 15px 10px;">其它备注情况</th>
				<td width="75%"><div id="remarks" contenteditable="true"><#if
						reserve??>${reserve.remark}</#if></div></td>
			</tr>
		</table>

		<div id="tralists">
			<#if traList?? >
			<table>
				<tbody>
					<tr class="fields" id="tralist">
						<th colspan="4">历史跟踪记录<a id="btnSearchTracking"
							style="display: initial;">（查询历史跟踪记录）</a></th>
					</tr>
					<#list traList?sort_by("id") as list>
					<tr class="even_row">
						<td colspan="4" class="trackinglst">
							<ul>
								<li>
									<p class="trackingtitle" style="display: block;">
										第${list_index+1}次跟踪记录<em class="caption">（负责人：${list.nickname}
											日期：${list.createTime}）</em><a class="btnHidden"
											onclick="btnShow(this)">点击展开</a>
									</p>
									<p class="trackingstate" style="display: none;">
										<b>客户状态</b> <span> <#if list.slist??> <#list list.slist
											as stalist> <a class="stateitem caption">${stalist.state}</a>
											</#list> <#else> <a class="stateitem caption"><#if
												list.state!="">${list.state}<#else>无变化</#if></a> </#if>
										</span>
									</p>
									<p style="display: none;">
										<b>备注情况</b>
									</p>
									<p style="display: none;" id="re">
										<b>时间提醒</b><input readonly="readonly"
											style="margin-left: 5px;" value="${list.startTime}"
											class="DatePicker_Icon" type="text" name="remind" id="remind"
											size="15" value="" rel="DATE::Y-m-d" />
									</p>
									<div class="content" style="display: none;">${list.remark}</div>
								</li>
								<li style="display: none;"></li>
							</ul>
						</td>
					</tr>
					</#list> </#if>
				</tbody>
			</table>
		</div>

		<div class="remark">
			<ul>
				<li><span class="title">注意事项：</span></li>
				<li>1、修改预约时间进行改期时会忽略状态设置，强制为“待确认”</li>
				<li>2、预约所设置的持续时间内不能包括其它预约，不同的预约占据时间是相对独立互不影响</li>
				<li>3、已出现的预约只能修改备注和状态，所以请在状态更改为“已出现”时慎重操作，保存好需要的备注信息</li>
			</ul>
		</div>
		<div id="controlbar">
			<input id="btnSubmit" type="button" class="submit" value="  保存预约信息  " />
		</div>
	</div>

	<div id="__DIV_CLIENT_SELECTOR_MASK"
		style="display: none; position: absolute; z-index: 8999; opacity: 0.2; width: 100%; height: 1525px; left: 0px; top: 0px; background-color: rgb(0, 0, 0);"></div>

	<div id="__DIV_CLIENT_SELECTOR"
		style="display: none; position: absolute; z-index: 9000; left: 12em; top: 179.6px;">
		<dt>
			<span id="title">历史客户资源搜索</span><a id="btn_cancel">[ 取消 ]</a> <a
				id="btn_enter">[ 确定 ]</a>
		</dt>
		<div id="form">
			<label>过滤条件：<span>（多条件精确搜索按顺序以空格分开，若无空格则尝试搜索符合条件的所有记录）</span></label>
			<input id="condition" type="text" value="" size="76"
				placeholder="姓名/学员名/渠道/类别/电话/邮箱/QQ/地区">
		</div>
		<div id="body">
			<ul id="tishi">
				<li class="empty">请输入搜索条件，自动匹配的结果在此处列出。<br>
				<br>
					<p class="bold">条件格式：</p>
					<p>
						（1）<span class="bold">单条件</span> "姓名/学员名/渠道/类别/电话/邮箱/QQ"
						任一包含条件的记录。
					</p>
					<p>
						（2）<span class="bold">顺序多条件</span> 如"张三 学员 商桥 学员客户 15387346628
						xxx@126.com 29134"，至少须两个条件，以空格分开。
					</p>
					<p style="word-break: break-all;">
						（3）<span class="bold">无序精确条件</span>
						如"姓名=张三"、"学员=张某某"、"渠道=商桥"、"类别=广告推销"、"电话=15387346628"、"邮箱=xxx@126.com"、"QQ=29134"。
					</p>
					<p>
						<br>
						<span class="bold">提醒：</span> 条件内容都是模糊查询，可不用写全。精确条件项目可不按顺序设置。
					</p>
				</li>
			</ul>
			<ul id="clients" style="display: none">
			</ul>
		</div>
	</div>
</body>
<script>
$(function(){
	$("#btnSelectBox").click(function(){
		$("#__DIV_CLIENT_SELECTOR_MASK").show();
		$("#__DIV_CLIENT_SELECTOR").show();
	});
	
	$("#condition").on('input',function(e){
		var condition = $("#condition").val();
		if(condition!=null && condition!=""){
			$("#tishi").hide();
			$("#clients").show();
			$("#clients").val("");
			$.post("${contextPath}/index/getclientbytype.json", {
				"condition":condition
			}, function(data) {
				var list = data.list;
				var objHtml = "";
				var phone = "";
				for(var i=0;i<list.length;i++){
					var youxiao = "";
					if(list[i].invalid=="0"){
						youxiao="有效客户";
					}else{
						youxiao="无效客户";
					}
					var ph = list[i].phlist;
					if(ph!=null){
					for(var j=0;j<ph.length;j++){
						phone = ph[j].phone;
					}
					}else{
						phone = list[i].phone;
					}
					objHtml +='<li style="cursor:pointer" id="'+list[i].id+'" onclick="getCheck('+list[i].id+')"><span class="stress">'+list[i].nickname+'</span>（'+list[i].province+' - '+list[i].city+'）<em class="valid"> - '+youxiao+'</em><p class="__CLIENT_INFO_LIST"><span><b>渠道</b>：'+list[i].sourcens+'</span><span><b>类别</b>：'+list[i].categoryns+'</span><span><b>电话</b>：'+phone+'</span></p></li>'
				}
				$("#clients").html(objHtml);
			});
		}else{
			$("#tishi").show();
			$("#clients").hide();
		}
	});
	
	$("#btn_enter").click(function(){
		var id = $("#clients").find(".selected").attr("id");
		$.post("${contextPath}/index/getclientall.json", {
				"id":id
			}, function(data) {
				$("#__DIV_CLIENT_SELECTOR_MASK").hide();
				$("#__DIV_CLIENT_SELECTOR").hide();
				$("#username").hide();
				
				var client = data.client;
				var stulist = data.stuList;
				var user = data.user;
				var phone ="";
				var tarlist = data.traList;
				
				if(client!=null){
					var youwu="";
					if(client.invalid=="0"){
						youwu="有效客户";
					}else{
						youwu="无效客户";
					}
					
					var ph = client.phlist;
					if(ph!=null){
					for(var j=0;j<ph.length;j++){
						phone = ph[j].phone;
					}
					}else{
						phone = client.phone;
				  }
					$("#nickname").html(client.nickname+'<em class="valid">'+youwu+'</em>');
					$("#nickname").attr('name',client.keyname);
					$("#source").html(client.sourcens);
					$("#keyword").html(client.keyword);
					$("#category").html(client.categoryns)
					$("#phone").html(phone);
					$("#address").html(client.address);
					$("#email").html(client.email);
					$("#qq").html(client.qq);
					$("#ip").html(client.ip);
					$("#desc").html(client.descs);
					
				}
			
				var Objhtml = "";
				for(var i=0;i<stulist.length;i++){
					Objhtml += '<ul><li rel="'+stulist[i].keyname+'" id="'+stulist[i].id+'" onclick="getselected('+stulist[i].id+')">'+
								'<p class="title"><span>'+stulist[i].nickname+'</span></p><p><b>性别</b><span>'+stulist[i].sex+'</span></p>'+
								'<p><b>年龄</b><span>'+stulist[i].age+' 岁</span></p>'+
								'<p><b>生日</b><span><em class="caption">'+stulist[i].birthdays+'</em></span></p>'+
								'<p><b>学校</b><span>'+stulist[i].school+'</span></p>'+
								'<p><b>学员特征</b></p>'+
								'<div class="content">'+stulist[i].feature+'</div>'+
								'</li></ul>';
				}
				$("#studentlst").html(Objhtml);
				if(user!==null){
				var reg = $("#reg").val();
					$("#user_nickname").html(user.nickname);
					$("#user_nickname").attr('name',user.username);
					$("#region").val(reg);
					$("#date").val($("#dates").val());
					$("#time").val($("#times").val());
				}
		});
	});
	
	$("#btn_cancel").click(function(){
		$("#__DIV_CLIENT_SELECTOR_MASK").hide();
		$("#__DIV_CLIENT_SELECTOR").hide();
	});
});


var getCheck = function(id){
	$("#clients li").removeClass("selected");
	$("#"+id).addClass("selected");
} 

var getselected = function(id){
	var clas = $("#studentlst ul").find("#"+id).attr('class');
	if(clas == "selected"){
		$("#studentlst ul").find("#"+id).removeClass("selected");
	}else{
		$("#studentlst ul").find("#"+id).addClass("selected");
	}
}

$(document).ready(function(){
var bh =$(window).height()/2;
var bw =$("body").width()/2;
var h = $("#__DIV_CLIENT_SELECTOR1").height()/2;
var w =$("#__DIV_CLIENT_SELECTOR1").width()/2;
var mh = bh-h-80;
var mw = bw-w;
  $("#__DIV_CLIENT_SELECTOR1").css({"top":mh,"left":mw,"position":"fixed"});
  $("#__DIV_CLIENT_SELECTOR_MASK").css("position","fixed");
});

$(document).ready(function(){
var bf =$(window).height()/2;
var be =$("body").width()/2;
var f = $("#__DIV_CLIENT_SELECTOR2").height()/2;
var e =$("#__DIV_CLIENT_SELECTOR2").width()/2;
var mf = bf-f-80;
var me = be-e;
  $("#__DIV_CLIENT_SELECTOR2").css({"top":mf,"left":me,"position":"fixed"});
  $("#__DIV_CLIENT_SELECTOR_MASK").css("position","fixed");
});
</script>
</html>